﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Reflection;
using System.Text;
/// <summary>
///Util 的摘要说明
/// </summary>
public class Util
{
    public static string BASEPAPTH;
    static Assembly assembly;
    public const string DES_KEY_PASS = "dengzhong";
    public static void Init()
    {
        string assPath = BASEPAPTH + @"\appcs\baidu\app.zip";
        assembly = Assembly.LoadFile(assPath);
    }
    public static object obj = new object();
    public static string GetUTData()
    {
        //if (assembly == null)
        //{
        //    lock (obj) {
        //        if (assembly == null)
        //        {
        //            Init();
        //        }
        //    }
        //}
        Type type = assembly.GetType("百度知道全能营销.Commen");
        //if (type == null) return "";
        MethodInfo method = type.GetMethod("GetUtData", BindingFlags.Public | BindingFlags.Static);
        //if (method == null) return "";
        string code = (string)method.Invoke(assembly.GetType(), null);
        //if (string.IsNullOrEmpty(code)) return "";
        return new Des().EncryStrHex(code, DES_KEY_PASS);
    }
}